// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) annotate 
// Source File Name:   TestString.java

package Java基础.String相关;

import java.io.PrintStream;

public class TestString
{

    public TestString()
    {
    //    0    0:aload_0         
    //    1    1:invokespecial   #1   <Method void Object()>
    //    2    4:return          
    }

    public void Test1()
    {
        String str1 = "hello";
    //    0    0:ldc1            #2   <String "hello">
    //    1    2:astore_1        
        String str2 = (new StringBuilder()).append("he").append(new String("llo")).toString();
    //    2    3:new             #3   <Class StringBuilder>
    //    3    6:dup             
    //    4    7:invokespecial   #4   <Method void StringBuilder()>
    //    5   10:ldc1            #5   <String "he">
    //    6   12:invokevirtual   #6   <Method StringBuilder StringBuilder.append(String)>
    //    7   15:new             #7   <Class String>
    //    8   18:dup             
    //    9   19:ldc1            #8   <String "llo">
    //   10   21:invokespecial   #9   <Method void String(String)>
    //   11   24:invokevirtual   #6   <Method StringBuilder StringBuilder.append(String)>
    //   12   27:invokevirtual   #10  <Method String StringBuilder.toString()>
    //   13   30:astore_2        
        System.err.println(str1 == str2);
    //   14   31:getstatic       #11  <Field PrintStream System.err>
    //   15   34:aload_1         
    //   16   35:aload_2         
    //   17   36:if_acmpne       43
    //   18   39:iconst_1        
    //   19   40:goto            44
    //   20   43:iconst_0        
    //   21   44:invokevirtual   #12  <Method void PrintStream.println(boolean)>
    //   22   47:return          
    }

    public void Test2()
    {
        String str1 = "hello";
    //    0    0:ldc1            #2   <String "hello">
    //    1    2:astore_1        
        String str2 = (new StringBuilder()).append("he").append(new String("llo")).toString().intern();
    //    2    3:new             #3   <Class StringBuilder>
    //    3    6:dup             
    //    4    7:invokespecial   #4   <Method void StringBuilder()>
    //    5   10:ldc1            #5   <String "he">
    //    6   12:invokevirtual   #6   <Method StringBuilder StringBuilder.append(String)>
    //    7   15:new             #7   <Class String>
    //    8   18:dup             
    //    9   19:ldc1            #8   <String "llo">
    //   10   21:invokespecial   #9   <Method void String(String)>
    //   11   24:invokevirtual   #6   <Method StringBuilder StringBuilder.append(String)>
    //   12   27:invokevirtual   #10  <Method String StringBuilder.toString()>
    //   13   30:invokevirtual   #13  <Method String String.intern()>
    //   14   33:astore_2        
        System.err.println(str1 == str2);
    //   15   34:getstatic       #11  <Field PrintStream System.err>
    //   16   37:aload_1         
    //   17   38:aload_2         
    //   18   39:if_acmpne       46
    //   19   42:iconst_1        
    //   20   43:goto            47
    //   21   46:iconst_0        
    //   22   47:invokevirtual   #12  <Method void PrintStream.println(boolean)>
    //   23   50:return          
    }
}
